<template>
  <div id="OneLine-vue">

  </div>
</template>

<script>
export default {
  mounted() {
    this.echarts()
  },
  methods: {
    echarts() {
      let myChart = this.$echarts.init(document.getElementById('OneLine-vue'))
      myChart.setOption({
        title: {
          text: '产品排放变化图',
          textStyle: {
            color: 'white'
          }
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#6a7985'
            }
          }
        },
        legend: {
          data: ['Product1', 'Product2'],
          textStyle: {
            color: 'white'
          }
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: [
          {
            type: 'category',
            boundaryGap: false,
            axisLine: {
              lineStyle: {
                color: 'white',
                width: 2
              }
            },
            data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月'],
          }
        ],
        yAxis: [
          {
            type: 'value',
            axisLine: {
              lineStyle: {
                color: 'white',
                width: 2
              }
            },
          }
        ],
        series: [
          {
            name: 'Product1',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [120, 132, 101, 134, 90, 230, 510]
          },
          {
            name: 'Product2',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [220, 182, 191, 234, 290, 330, 610]
          }
        ]
      });
    }
  }
}
</script>

<style scoped>
#echartsID {
  width: 90%;
  height: 70%;
}
</style>
